package com.cloud.mall.oms.service;

import com.cloud.mall.api.CommonPage;
import com.cloud.mall.base.BaseResponse;
import com.cloud.mall.oms.dto.OmsMoneyInfoParam;
import com.cloud.mall.oms.dto.OmsOrderDeliveryParam;
import com.cloud.mall.oms.dto.OmsOrderQueryParam;
import com.cloud.mall.oms.dto.OmsReceiverInfoParam;
import com.cloud.mall.oms.dto.order.OmsOrderDetail;
import com.cloud.mall.oms.out.OmsOrderOut;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "订单管理")
@RequestMapping("/order")
public interface OmsOrderService {

    @ApiOperation("查询订单")
    @GetMapping("/list")
    BaseResponse<CommonPage<OmsOrderOut>> list(@RequestBody OmsOrderQueryParam queryParam,
                                               @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum);
    @ApiOperation("批量发货")
    @PostMapping("/update/delivery")
    BaseResponse delivery(@RequestBody List<OmsOrderDeliveryParam> deliveryParamList);

    @ApiOperation("批量关闭订单")
    @PostMapping("/update/close")
    BaseResponse close(@RequestParam("ids") List<Long> ids, @RequestParam String note);

    @ApiOperation("批量删除订单")
    @PostMapping("/delete")
    BaseResponse delete(@RequestParam("ids") List<Long> ids);

    @ApiOperation("获取订单详情:订单信息、商品信息、操作记录")
    @GetMapping("/{id}")
    BaseResponse<OmsOrderDetail> detail(@PathVariable Long id);

    @ApiOperation("修改收货人信息")
    @PostMapping("/update/receiverInf")
    BaseResponse updateReceiverInfo(@RequestBody OmsReceiverInfoParam receiverInfoParam);

    @ApiOperation("修改订单费用信息")
    @PostMapping("/update/moneyInfo")
    BaseResponse updateReceiverInfo(@RequestBody OmsMoneyInfoParam moneyInfoParam);

    @ApiOperation("备注订单")
    @PostMapping("/update/note")
    BaseResponse updateNote(@RequestParam("id") Long id,
                                   @RequestParam("note") String note,
                                   @RequestParam("status") Integer status);
}
